home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Business & Presentations
/
Business and Presentations - Volume 1 (1995)(Sideface)(NL).iso
/
hputils
/
ibm2hpj
/
lptx.doc
< prev
next >
Wrap
Text File
|
1985-08-24
|
6KB
|
135 lines
LPTx : Line Printer Output Capture Routine
-------------------------------------------------------------
Version 3.0
(C) Copyright 1985 by Mark DiVecchio, All Rights Reserved
You may use and freely distribute this program for
non-commercial applications.
Mark C. DiVecchio
9067 Hillery Drive
San Diego, CA 92126
619-566-6810
-------------------------------------------------------------
Have you ever wanted to get some data from your screen into a
program? Have you ever wanted to grab onto some printer data and put it into
a disk file but the program you are using does not have that as a option?
Well here is the answer to your problem. This program will grab onto
anything sent out of a line printer port as long as the program uses the
standard BIOS INT 17h call. I have tried this with printscreen, with
printscreen in graphics mode (produces some mighty unusual output), with
SIDEWAYS, with the copy command to LPT1: etc, with my word processor
(FinalWord), with MASM (direct output to LPT1) with Wordstar, with 1-2-3 and
with the DOS '>' redirection command line option. It all seems to work.
This program intercepts the BIOS interrupt 17, the line printer
interrupt. It will redirect the output of LPT1, LPT2, or LPT3 to a disk
file. All three redirections may be active at the same time.
LPTx requires DOS 2.0 or later.
Calling sequence:
lptx -1 -o <d:[pathname]filename>
where -1 means redirect LPT1, -2 means redirect LPT2, -3 means redirect
LPT3
This option must appear first
-o means start the redirection to file specified. If redirection
is already in progress for the selected line printer,
the old file will be closed first.
(If you do not specify -o but you do specify a line printer,
LPTx will use either the last file name that you gave when
you loaded LPTx or will use the file named LPTXy.LST which it
will create in the root directory on the default drive - where
y is 1, 2, or 3.)
It is not necessary that you specify the complete path name
for the file. LPTx will create the file in the default
directory if you don't specify a directory. LPTx will always
be able to find the file because it saves the complete path.
-c means close the file and send all further output directly to the
line printer.
If neither option is specified, LPTx just displays the program status.
note: -1, -2, and -3 are mutually exclusive
-o and -c are mutually exclusive
examples:
lptx Displays the program status
lptx ? Displays a HELP screen
lptx -1 redirects LPT1 output to file named
LPTX1.LST in the root directory
on the default drive or the last
named file.
lptx -o a:\able.xxx redirects LPT1 output to file named
or a:\able.xxx. Any open redirection
lptx a:\able.xxx disk file for LPT1 is closed.
lptx -2 b:xx.lst redirects LPT2 output to file named
XX.LST in the default directory
on drive B:. Any open redirection
disk file for LPT2 is closed.
lptx -3 d:\ab\cd\file.lst redirects LPT3 output to the file named
file.lst in the directory ab\cd on drive
d:.
lptx -c closes any disk files open for LPT1 and sends
or the output back to the line printer
lptx -1 -c If no redirection is taking place to LPT1,
this is a NOP. LPT2 and LPT3 are not
affected.
lptx -2 -c closes any disk file open for LPT2 and
sends the output back to line printer.
if no redirection is taking place to LPT2,
this is a NOP. LPT1 and LPT3 are not
affected.
By redirecting LPT2 or LPT3 to a disk file, you can in effect have 2
or 3 printers on your system. LPT1 can be your physical printer and you can
have LPT2 output going to disk. When you redirect LPT2 or LPT3, LPT1 works
normally.
If you are redirecting to a diskette file, do not remove the diskette
once the redirection starts. I recommend redirecting to a hard disk or a RAM
disk.
If LPTx encounters any kind of error during the redirection, it
terminates operation and sends output back to the line printer. It does not
display anything but beeps the speaker four times. This prevents your
currently running program from possibly getting destroyed. An error with
LPT1 redirection does not shut down LPT2 or LPT3 redirection.
LPTx captures the int 17h interrupt vector. Problems may occur with
print spoolers which also take over the int 17h vector. You can be sure that
LPTX works correctly by running LPTX after you have run your print spooler.
LPTX will be transparent to the print spooler but your print spooler may not
be transparent to LPTX. LPTX works fine with IBM's PRINT command.
LPTx also captures the int 24h critical error interrupt vector. This
is done only for the period that LPTx is using the disk. This prevents the
generation of funny error messages in the middle of other programs that you
may be running. (LPTx just beeps 4 times and clears itself out of way if a
disk error occurs).
This version of LPTx can redirect all three printers to three
different files with all 3 active at the same time.
LPTx uses about 7K of memory for the resident data buffers and
interrupt handler.
If you modify or find any bugs in this program, I would appreciate
it if you would drop me a line with the changes. Use the address above.